<extend name="Layout/ins_popup" />
<block name="content">
	<div class="popup-fixed">
		<div class="popup-header clearfix">
			<div class="pull-left">
				<h1>添加成员</h1>
			</div>
			<div class="pull-right">
				<a onclick="save();" class="btn btn-sm btn-primary">确定</a>
				<a onclick="myclose();" class="btn btn-sm btn-default">关闭</a>
			</div>
			<form name="form_search" id="form_search" method="post" class="pull-right" style="padding-right:10px;">
				<div class="input-group col-15">
					<input class="form-control" type="text" name="keyword" id="keyword">
					<div class="input-group-btn">
						<a class="btn btn-sm btn-info" onclick="submit_search();"><i class="fa fa-search"></i></a>
					</div>
				</div>
			</form>
		</div>
		<div class="popup-body" style="height: 420px;overflow-y: auto;">
			<form id="form_data" name="form_data" method="post" >
				<input type="hidden" name="opmode" id="opmode" value="add">
				<input type="hidden" name="group_id" id="group_id" value="{$group_id}">
				<table class="table table-bordered">
					<thead>
						<tr>
							<th class="text-center col-6">
							<input class="ace" type="checkbox" name="id-toggle-all" id="id-toggle-all" />
							</th>
							<th>
							<nobr>
								员工编号
							</nobr></th>
							<th>
							<nobr>
								姓名
							</nobr></th>
							<th>
							<nobr>
								部门
							</nobr></th>
							<th class="hidden">
							<nobr>
								职级
							</nobr></th>
							<th>
							<nobr>
								职位
							</nobr></th>
							<th>
							<nobr>
								状态
							</nobr></th>
						</tr>
					</thead>
					<tbody class="tbody">
						<volist name="user_list" id="data">
							<tr id="{$data.id}">
								<td class="text-center col-6">
								<input class="ace" type="checkbox" name="user_id[]" value="{$data.id}" />
								</td>
								<td>
								<nobr>
									{$data.emp_no}
								</nobr></td>
								<td>
								<nobr>
									{$data.name}
								</nobr></td>
								<td>
								<nobr>
									{$data.dept_name}
								</nobr></td>
								<td class="hidden">
								<nobr>
									{$data.rank_name}
								</nobr></td>
								<td>
								<nobr>
									{$data.position_name}
								</nobr></td>
								<td>
								<nobr>
									{$data.is_del|status}
								</nobr></td>
							</tr>
						</volist>
					</tbody>
				</table>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
			if ($("input:checked[name='user_id[]']").length < 1) {
				ui_error("请选择用户");
				return false;
			};

			var vars = $("#form_data").serialize();
			sendAjax("{:U('save_user')}", vars, function(data) {
				if (data.status) {
					ui_alert(data.info, function() {
						parent.location.reload(true);
						myclose();
					});
				}
			});

		}
	</script>
</block>